<?php 
$hoy = strftime('%Y-%m-%H');
include('../Connections/KRAPPERCON.php');
include('../Connections/Accesos.php');
?>
<div>
<input type="button" value="Borrar Filtros" onclick='$("#tbl_ld input").val("");' />&nbsp;
<input type="button" value="Buscar" onclick='searchRptPedidos()' />
</div>
<table width="100%" id="tbl_ld" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td>Clase de Documento :</td>
    <td>
    <select name="cbo_ld_cldoc" id="cbo_ld_cldoc">
    <option value="">Todos</option>
       <?php 
		$cladoc = 'PD';
		include('../Query_Min/getClaDocs.php');
		?>
      </select>
        </select>    </td>
  </tr>
  <tr class="noView">
    <td>Fecha de Creacion :</td>
    <td>
      <input name="t_ld_fcini"  class="tcal" value=" " type="text" id="t_ld_fcini" size="12" maxlength="10">
    a 
    <input name="t_ld_fcfin"  class="tcal" type="text" id="t_ld_fcfin" size="12" maxlength="10">   </td>
  </tr>
  <tr>
    <td>Placa Veh&iacute;culo :</td>
    <td><input name="t_ld_vehi" type="text" id="t_ld_vehi" size="20" maxlength="10" /></td>
  </tr>
  <tr>
    <td>Fecha de Documento :</td>
    <td>
      <input name="t_ld_fdini" value="<?php echo $hoy; ?>"  class="tcal" type="text" id="t_ld_fdini" size="12" maxlength="10">
      a
  <input name="t_ld_fdfin"  class="tcal" type="text" id="t_ld_fdfin" size="12" maxlength="10">   </td>
  </tr>
  <tr>
    <td>Cliente :</td>
    <td>
      <input name="t_ld_codcli" type="text" id="t_ld_codcli" size="15" maxlength="10">   </td>
  </tr>
  <tr>
    <td>Referencia :</td>
    <td>
      <input name="t_ld_refped" type="text" id="t_ld_refped" size="30" maxlength="20">    </td>
  </tr>
  <tr>
    <td><input type="checkbox" name="chk_pnd" id="chk_pnd" />&nbsp;Solo Documentos Pendientes</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td colspan="2">
    <div id="d_ld_tbl"></div>    </td>
  </tr>
</table>
<script type="text/javascript">
function searchRptPedidos(){
	var check='';
	if (GEBI('chk_pnd').checked){
	check = '0';
	}
	else{
	check = '';
	}
	$('#d_ld_tbl').loadx('Consultas/Opers/queryDocVta.php',
	{
	t_cl_doc : GEBI('cbo_ld_cldoc').value,
	t_fc_ini : GEBI('t_ld_fcini').value,
	t_fc_fin : GEBI('t_ld_fcfin').value,	
	t_fd_ini : GEBI('t_ld_fdini').value,
	t_fd_fin : GEBI('t_ld_fdfin').value,		
	t_codcli : GEBI('t_ld_codcli').value,
	t_refped : GEBI('t_ld_refped').value,
	t_ld_vehi : GEBI('t_ld_vehi').value,
	t_pend : check
	}
	,
	function(){
	});
}

function goPedido(obj){
	loadPopup({url : 'Procesos/MantPedidos.php?oper=view&pedido='+ $(obj).html()});
}
</script>